<php>
	$this->display(tpl('head',true));
</php>
<style>
	.layui-table thead tr th{
		text-align: center;
	}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  	<legend>广告列表</legend>
</fieldset>
<table class="layui-table" cellspacing="0" cellpadding="0" border="0"  lay-filter="demoEvent">
	<thead>
		<tr>
			<th width="40">Id</th>
			<th>广告位名称</th>
			<th width="100">广告类型</th>
			<th width="130">操作</th>
		</tr>
	</thead>
	<tbody>
		<foreach array="data">
		<php>
			if($row['ad_type']=="images"){
				$row['ad_type']="图片类型";
			}elseif($row['ad_type']=="text"){
				$row['ad_type']="文字类型";
			}else{
				$row['ad_type']="代码类型";
			}
		</php>
			
		<tr>
			<td align="center">{{$row['id']}}</td>
			<td>{{$row['name']}}</td>
			<td align="center">{{$row['ad_type']}}</td>
			<td align="center">
				<a class="layui-btn layui-btn-sm layui-btn-warm" href="{{PLUGIN_ACTION}}index/buy/tag/{{$row['tag']}}">购买</a>
			</td>
		</tr>
		</foreach>
	</tbody>
</table>
<div class="page">
	{{$Get_Page}}
</div>
<php>
	$this->display(tpl('foot',true));
</php>
